<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<html>
<head>
    <title>资讯列表</title>
    <link rel="stylesheet" href="${ctx}/static/styles/news/newslist.css" type="text/css">
</head>

<body>
<div class="news-main">
    <div class="container">
        <h2>新闻资讯</h2>
        <h3>最新&nbsp;&nbsp;最快&nbsp;&nbsp;最全&nbsp;&nbsp;最权威</h3>
        <ul class="news-list">

            <c:forEach items="${newsPage.content}" var="news">
                <li class="news-item">
                    <div class="news-title">
                        <a href="${ctx}/news/detail/${news.id}">${news.title}</a>
                    </div>
                    <div class="news-abstract">
                            ${news.shortContent}
                    </div>
                    <div class="news-info">
                        <span>作者：${news.author.name}</span>
                        <span>发表时间：<fmt:formatDate value="${news.publishDate}" type="date" dateStyle="long"/></span>
                    </div>
                    <div class="news-more">
                        <a href="#">阅读全文 >></a>
                    </div>
                </li>
            </c:forEach>
        </ul>
        <tags:pagination page="${newsPage}" paginationSize="5"/>
    </div>
</div>
</body>
</html>
